#ifndef DOWN_H
#define DOWN_H

#include <iostream>
#include <stack>

using namespace std;

void Down(int arr[8])
{
    stack<int> num;
    stack<int> zero;

    for (int i = 0; i < 8; i++)
    {
        if (arr[i] == 0)
        {
            zero.push(i);
        }
        else
        {
            num.push(arr[i]);
        }
    }
    int i = 7;
    while(i>=0)
    {
        while(!num.empty())
        {
            arr[i] = num.top();
            num.pop();
            i--;
        }
        while(!zero.empty())
        {
            arr[i] = 0;
            zero.pop();
            i--;
        }
    }
}

#endif